namespace :import do

  channels = [:seoul_fm, :changwon_fm, :kwangju_fm,
   :pusan_fm, :ulsan_fm, :daegu_fm,
   :moekpo_fm, :youngdong_fm, :jeju_fm,
   :pohang_fm, :taejeon_fm]

  desc "import all of time table to db"
  task :all => channels

  channels.each do |ch_name|
    desc "#{ch_name} channel"
    task ch_name => :environment do
      puts " #{ch_name} channel import.."

      tti = TimeTableImporter.new(ch_name)
      tti.import_from_excel("#{Rails.root}/doc/time_table/#{ch_name}.xls")
    end
  end

end
